package seatiger.tomcat.catalina.connector.http;

import java.io.IOException;
import java.net.InetAddress;

/**
 * 基于http1.1 协议实现的
 */
@Deprecated
public class HttpRequestImpl extends HttpRequestImpl_middle{
    //服务器ip地址
    protected InetAddress inet = null;

    public void setInet(InetAddress inet) {
        this.inet = inet;
    }

    public InetAddress getInet() {
        return inet;
    }

    @Override
    public void recycle() {
        super.recycle();
        inet = null;
    }

    @Override
    public void finishRequest() throws IOException {
        //没有使用过请求流，就需要流中数据读取干净
        if ((stream == null) && (getContentLength() != 0)
                && (getProtocol() != null) && (getProtocol().equals("HTTP/1.1"))){
            getInputStream();
        }
        super.finishRequest();
    }
}
